
import os
import time


class DockerImage:
    def __init__(self):
        self.sh_file = '/root/.local/bin/get_docker_image'

    def update(self, shellPath=None, imageName=None):
        sp = self.sh_file
        if shellPath:
            sp = shellPath

        if imageName:
            cmd = sp + ' ' + imageName
            print(u'执行本地脚本' + cmd)
            print('')
            os.system(cmd)
        else:
            print('image name is null')



if __name__ == '__main__':
    image = DockerImage()
    image.update('~/test.sh', 'test')
    image.update(imageName='test')
